{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\f002mrh\Dropbox\Trade Attitudes\Data and Code\Replication Files for FPA\\UKcodinglog.txt
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}20 Nov 2020, 12:04:05
{txt}
{com}. **** Demographic characteristics, Partisanship, Ideology
. *Education
. *University graduate
. gen university=0
{txt}
{com}. replace university=1 if education_level==16
{txt}(1397 real changes made)

{com}. replace university=1 if education_level==17
{txt}(615 real changes made)

{com}. replace university=1 if education_level==18
{txt}(834 real changes made)

{com}. 
. *Race
. tab ethnicity

  {txt}To which of these groups {c |}
       do you consider you {c |}
                   belong? {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
             White British {c |}{res}      5,762       88.65       88.65
{txt}Any other white background {c |}{res}        272        4.18       92.83
{txt} White and Black Caribbean {c |}{res}         17        0.26       93.09
{txt}   White and Black African {c |}{res}         15        0.23       93.32
{txt}           White and Asian {c |}{res}         28        0.43       93.75
{txt}Any other mixed background {c |}{res}         23        0.35       94.11
{txt}                    Indian {c |}{res}         48        0.74       94.85
{txt}                 Pakistani {c |}{res}         18        0.28       95.12
{txt}               Bangladeshi {c |}{res}         10        0.15       95.28
{txt}Any other Asian background {c |}{res}         18        0.28       95.55
{txt}           Black Caribbean {c |}{res}         22        0.34       95.89
{txt}             Black African {c |}{res}         32        0.49       96.38
{txt}Any other black background {c |}{res}          6        0.09       96.48
{txt}                   Chinese {c |}{res}         35        0.54       97.02
{txt}        Other ethnic group {c |}{res}         46        0.71       97.72
{txt}                   Refused {c |}{res}        148        2.28      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      6,500      100.00
{txt}
{com}. gen white = 0
{txt}
{com}. replace white =1 if ethnicity==1 | ethnicity==2
{txt}(6034 real changes made)

{com}. tab ethnicity, gen(eth_)

  {txt}To which of these groups {c |}
       do you consider you {c |}
                   belong? {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
             White British {c |}{res}      5,762       88.65       88.65
{txt}Any other white background {c |}{res}        272        4.18       92.83
{txt} White and Black Caribbean {c |}{res}         17        0.26       93.09
{txt}   White and Black African {c |}{res}         15        0.23       93.32
{txt}           White and Asian {c |}{res}         28        0.43       93.75
{txt}Any other mixed background {c |}{res}         23        0.35       94.11
{txt}                    Indian {c |}{res}         48        0.74       94.85
{txt}                 Pakistani {c |}{res}         18        0.28       95.12
{txt}               Bangladeshi {c |}{res}         10        0.15       95.28
{txt}Any other Asian background {c |}{res}         18        0.28       95.55
{txt}           Black Caribbean {c |}{res}         22        0.34       95.89
{txt}             Black African {c |}{res}         32        0.49       96.38
{txt}Any other black background {c |}{res}          6        0.09       96.48
{txt}                   Chinese {c |}{res}         35        0.54       97.02
{txt}        Other ethnic group {c |}{res}         46        0.71       97.72
{txt}                   Refused {c |}{res}        148        2.28      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      6,500      100.00
{txt}
{com}. 
. *Gender
. recode w2sex1 (1=1) (2=0), gen(male)
{txt}(1273 differences between w2sex1 and male)

{com}. 
. *Age
. gen age1 = 0
{txt}
{com}. replace age1 = 1 if age < 30
{txt}(925 real changes made)

{com}. gen age2 = 0
{txt}
{com}. replace age2 = 1 if age < 45 & age > 29
{txt}(1613 real changes made)

{com}. gen age3 = 0
{txt}
{com}. replace age3 = 1 if age > 44 & age < 65
{txt}(2576 real changes made)

{com}. gen age4 = 0
{txt}
{com}. replace age4 = 1 if age > 64
{txt}(1386 real changes made)

{com}. 
. *Partisanship
. gen labour = 0
{txt}
{com}. replace labour = 1 if w2UKparty1==2 | w2UKparty2==1 | w2UKparty3==3 
{txt}(727 real changes made)

{com}. gen libdem = 0 
{txt}
{com}. replace libdem = 1 if w2UKparty1==3 | w2UKparty2==2 | w2UKparty3==1  
{txt}(211 real changes made)

{com}. gen conserv = 0 
{txt}
{com}. replace conserv = 1 if w2UKparty1==1 | w2UKparty2==3 | w2UKparty3==2  
{txt}(603 real changes made)

{com}. gen ukip = 0
{txt}
{com}. replace ukip=1 if w2UKparty1==7 | w2UKparty2==7 | w2UKparty3==7
{txt}(142 real changes made)

{com}. gen snp = 0
{txt}
{com}. replace snp=1 if w2UKparty1==5 | w2UKparty2==5 | w2UKparty3==5
{txt}(56 real changes made)

{com}. gen green = 0
{txt}
{com}. replace green=1 if w2UKparty1==6 | w2UKparty2==6 | w2UKparty3==6
{txt}(63 real changes made)

{com}. gen noparty = 0
{txt}
{com}. replace noparty = 1 if  w2UKparty1==10 | w2UKparty2==10 | w2UKparty3==10
{txt}(373 real changes made)

{com}. gen pidother = 0
{txt}
{com}. replace pidother = 1 if w2UKparty1==4 | w2UKparty1==8 | w2UKparty1==9 | w2UKparty2==4 | w2UKparty2==8 | w2UKparty2==9 | w2UKparty3==8 | w2UKparty3==9
{txt}(46 real changes made)

{com}. gen pidother2 = 0
{txt}
{com}. replace pidother2 = 1 if ukip==1 | snp==1 | green==1 | noparty==1 | pidother==1
{txt}(680 real changes made)

{com}. 
. *Without UKIP on the right
. gen partyright = .
{txt}(6500 missing values generated)

{com}. replace partyright = 1 if conserv==1 
{txt}(603 real changes made)

{com}. replace partyright = 0 if labour==1 | libdem==1 | green==1 | snp==1
{txt}(1057 real changes made)

{com}. 
. *With UKIP on the right
. gen partyright2 = .
{txt}(6500 missing values generated)

{com}. replace partyright2 = 1 if conserv==1 | ukip==1
{txt}(745 real changes made)

{com}. replace partyright2 = 0 if labour==1 | libdem==1 | green==1 | snp==1
{txt}(1057 real changes made)

{com}. 
. *Employment Status
. tab work_status, gen(work_)

         {txt}Which of these applies to you? {c |}      Freq.     Percent        Cum.
{hline 40}{c +}{hline 35}
Working full time (30 or more hours per {c |}{res}      3,104       47.75       47.75
{txt}  Working part time (8-29 hours a week) {c |}{res}        654       10.06       57.82
{txt}Working part time (Less than 8 hours a  {c |}{res}         69        1.06       58.88
{txt}                      Full Time student {c |}{res}        245        3.77       62.65
{txt}                                Retired {c |}{res}      1,683       25.89       88.54
{txt}                             Unemployed {c |}{res}        245        3.77       92.31
{txt}                            Not working {c |}{res}        386        5.94       98.25
{txt}                                  Other {c |}{res}        114        1.75      100.00
{txt}{hline 40}{c +}{hline 35}
                                  Total {c |}{res}      6,500      100.00
{txt}
{com}. 
. gen workfull = 0
{txt}
{com}. replace workfull = 1 if work_1==1
{txt}(3104 real changes made)

{com}. gen workpart = 0 
{txt}
{com}. replace workpart = 1 if work_2==1 | work_3==1
{txt}(723 real changes made)

{com}. gen workstudent = 0
{txt}
{com}. replace workstudent = 1 if work_4==1
{txt}(245 real changes made)

{com}. gen workretired = 0
{txt}
{com}. replace workretired = 1 if work_5==1
{txt}(1683 real changes made)

{com}. gen workunemp = 0
{txt}
{com}. replace workunemp = 1 if work_6==1 | work_7==1
{txt}(631 real changes made)

{com}. gen workother = 0
{txt}
{com}. replace workother = 1 if work_8==1
{txt}(114 real changes made)

{com}. 
. 
. *Household income
. tab household_income, gen(inc_)

         {txt}What is your gross {c |}
          household income? {c |}      Freq.     Percent        Cum.
{hline 28}{c +}{hline 35}
                          0 {c |}{res}          3        0.05        0.05
{txt}       under 5,000 per year {c |}{res}        129        1.98        2.03
{txt}    5,000 to 9,999 per year {c |}{res}        299        4.60        6.63
{txt}  10,000 to 14,999 per year {c |}{res}        489        7.52       14.15
{txt}  15,000 to 19,999 per year {c |}{res}        466        7.17       21.32
{txt}  20,000 to 24,999 per year {c |}{res}        531        8.17       29.49
{txt}  25,000 to 29,999 per year {c |}{res}        515        7.92       37.42
{txt}  30,000 to 34,999 per year {c |}{res}        384        5.91       43.32
{txt}  35,000 to 39,999 per year {c |}{res}        384        5.91       49.23
{txt}  40,000 to 44,999 per year {c |}{res}        306        4.71       53.94
{txt}  45,000 to 49,999 per year {c |}{res}        256        3.94       57.88
{txt}  50,000 to 59,999 per year {c |}{res}        338        5.20       63.08
{txt}  60,000 to 69,999 per year {c |}{res}        244        3.75       66.83
{txt}  70,000 to 99,999 per year {c |}{res}        320        4.92       71.75
{txt}100,000 to 149,999 per year {c |}{res}        120        1.85       73.60
{txt}           150,000 and over {c |}{res}         43        0.66       74.26
{txt}                 Don't know {c |}{res}        441        6.78       81.05
{txt}       Prefer not to answer {c |}{res}      1,232       18.95      100.00
{txt}{hline 28}{c +}{hline 35}
                      Total {c |}{res}      6,500      100.00
{txt}
{com}. gen inc20 = 0
{txt}
{com}. replace inc20 = 1 if inc_1==1 | inc_2==1 | inc_3==1 | inc_4==1 | inc_5==1
{txt}(1386 real changes made)

{com}. gen inc2035 = 0
{txt}
{com}. replace inc2035 = 1 if inc_6==1 | inc_7==1 | inc_8==1
{txt}(1430 real changes made)

{com}. gen inc3560 = 0 
{txt}
{com}. replace inc3560 = 1 if inc_9==1 | inc_10==1 | inc_11==1 | inc_12==1
{txt}(1284 real changes made)

{com}. gen inc60up = 0
{txt}
{com}. replace inc60up = 1 if inc_13==1 | inc_14==1 | inc_15==1 | inc_16==1
{txt}(727 real changes made)

{com}. 
. *code don't know and prefer not to answer as missing
. foreach var of varlist inc20 inc2035 inc3560 inc60up {c -(}
{txt}  2{com}. replace `var' = . if inc_17==1 | inc_18==1
{txt}  3{com}. {c )-}
{txt}(1673 real changes made, 1673 to missing)
(1673 real changes made, 1673 to missing)
(1673 real changes made, 1673 to missing)
(1673 real changes made, 1673 to missing)

{com}. 
. 
. 
. ****Appendix Section 1.1: Nativism and Economic Perceptions Measurement 
. *Percent of sample dk on each item - range from 3.21 to 14.53% in the U.K. sample
. *Nativism
. * DK = 5.13%
. tab w2eupan1 

 {txt}Even in its milder forms, {c |}
 Islam is a serious danger {c |}
  to Western civilization. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        494       21.11       21.11
{txt}                     Agree {c |}{res}        520       22.22       43.33
{txt}Neither agree nor disagree {c |}{res}        444       18.97       62.31
{txt}                  Disagree {c |}{res}        475       20.30       82.61
{txt}         Strongly disagree {c |}{res}        287       12.26       94.87
{txt}                Dont know {c |}{res}        120        5.13      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. * DK = 3.21%
. tab w2eupan2

   {txt}The United Kingdom  has {c |}
       benefitted from the {c |}
 arrival in recent decades {c |}
                of people  {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        259       11.07       11.07
{txt}                     Agree {c |}{res}        781       33.38       44.44
{txt}Neither agree nor disagree {c |}{res}        530       22.65       67.09
{txt}                  Disagree {c |}{res}        373       15.94       83.03
{txt}         Strongly disagree {c |}{res}        322       13.76       96.79
{txt}                Dont know {c |}{res}         75        3.21      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *DK = 3.33%
. tab w2eupan3

{txt}All further immigration to {c |}
  the UK should be halted. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        678       28.97       28.97
{txt}                     Agree {c |}{res}        491       20.98       49.96
{txt}Neither agree nor disagree {c |}{res}        411       17.56       67.52
{txt}                  Disagree {c |}{res}        442       18.89       86.41
{txt}         Strongly disagree {c |}{res}        240       10.26       96.67
{txt}                Dont know {c |}{res}         78        3.33      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. * DK = 4.02%
. tab w2eupan4 

 {txt}The United Kingdom should {c |}
 allow more highly skilled {c |}
     immigrants from other {c |}
                    countr {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        132        5.64        5.64
{txt}                     Agree {c |}{res}        593       25.34       30.98
{txt}Neither agree nor disagree {c |}{res}        663       28.33       59.32
{txt}                  Disagree {c |}{res}        472       20.17       79.49
{txt}         Strongly disagree {c |}{res}        386       16.50       95.98
{txt}                Dont know {c |}{res}         94        4.02      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *DK = 3.68%
. tab w2eupan5

 {txt}The United Kingdom should {c |}
    allow more low-skilled {c |}
     immigrants from other {c |}
                 countries {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}         42        1.79        1.79
{txt}                     Agree {c |}{res}        102        4.36        6.15
{txt}Neither agree nor disagree {c |}{res}        360       15.38       21.54
{txt}                  Disagree {c |}{res}        689       29.44       50.98
{txt}         Strongly disagree {c |}{res}      1,061       45.34       96.32
{txt}                Dont know {c |}{res}         86        3.68      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *DK = 9.10%
. tab w2eupan6

{txt}Most crimes in Britain are {c |}
  committed by immigrants. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        180        7.69        7.69
{txt}                     Agree {c |}{res}        368       15.73       23.42
{txt}Neither agree nor disagree {c |}{res}        506       21.62       45.04
{txt}                  Disagree {c |}{res}        639       27.31       72.35
{txt}         Strongly disagree {c |}{res}        434       18.55       90.90
{txt}                Dont know {c |}{res}        213        9.10      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *DK = 8.68%
. tab w2eupan7

     {txt}Immigration in recent {c |}
years has helped Britains {c |}
  economy grow faster than {c |}
                    it wou {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        103        4.40        4.40
{txt}                     Agree {c |}{res}        445       19.02       23.42
{txt}Neither agree nor disagree {c |}{res}        510       21.79       45.21
{txt}                  Disagree {c |}{res}        564       24.10       69.32
{txt}         Strongly disagree {c |}{res}        515       22.01       91.32
{txt}                Dont know {c |}{res}        203        8.68      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *DK = 3.68%
. tab w2eupan8

     {txt}The Government should {c |}
  encourage immigrants and {c |}
   their families to leave {c |}
                 the Unite {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        339       14.49       14.49
{txt}                     Agree {c |}{res}        373       15.94       30.43
{txt}Neither agree nor disagree {c |}{res}        587       25.09       55.51
{txt}                  Disagree {c |}{res}        529       22.61       78.12
{txt}         Strongly disagree {c |}{res}        426       18.21       96.32
{txt}                Dont know {c |}{res}         86        3.68      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *DK = 14.53%
. tab w2eupan9

   {txt}Local councils normally {c |}
  allow immigrant families {c |}
      to jump the queue in {c |}
                allocating {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        474       20.26       20.26
{txt}                     Agree {c |}{res}        581       24.83       45.09
{txt}Neither agree nor disagree {c |}{res}        357       15.26       60.34
{txt}                  Disagree {c |}{res}        323       13.80       74.15
{txt}         Strongly disagree {c |}{res}        265       11.32       85.47
{txt}                Dont know {c |}{res}        340       14.53      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,340      100.00
{txt}
{com}. *Recode DK to midpoint*
. recode w2eupan1 (6=3), gen(w2eupan1a)
{txt}(120 differences between w2eupan1 and w2eupan1a)

{com}. recode w2eupan2 (6=3), gen(w2eupan2a)
{txt}(75 differences between w2eupan2 and w2eupan2a)

{com}. recode w2eupan3 (6=3), gen(w2eupan3a)
{txt}(78 differences between w2eupan3 and w2eupan3a)

{com}. recode w2eupan4 (6=3), gen(w2eupan4a)
{txt}(94 differences between w2eupan4 and w2eupan4a)

{com}. recode w2eupan5 (6=3), gen(w2eupan5a)
{txt}(86 differences between w2eupan5 and w2eupan5a)

{com}. recode w2eupan6 (6=3), gen(w2eupan6a)
{txt}(213 differences between w2eupan6 and w2eupan6a)

{com}. recode w2eupan7 (6=3), gen(w2eupan7a)
{txt}(203 differences between w2eupan7 and w2eupan7a)

{com}. recode w2eupan8 (6=3), gen(w2eupan8a)
{txt}(86 differences between w2eupan8 and w2eupan8a)

{com}. recode w2eupan9 (6=3), gen(w2eupan9a)
{txt}(340 differences between w2eupan9 and w2eupan9a)

{com}. 
. *alpha = 0.9010
. alpha w2eupan1a w2eupan2a w2eupan3a w2eupan4a w2eupan5a w2eupan6a w2eupan7a w2eupan8a w2eupan9a, item

{txt}Test scale = mean(unstandardized items)

                                                            average
                             item-test     item-rest       interitem
Item         {c |}  Obs  Sign   correlation   correlation     covariance      alpha
{hline 13}{c +}{hline 65}
w2eupan1a{col 14}{c |}{res}{col 16}2340{col 24}+{col 31} 0.7328{col 45} 0.6433{col 59} .7312969{col 73} 0.8923
{txt}w2eupan2a{col 14}{c |}{res}{col 16}2340{col 24}-{col 31} 0.8142{col 45} 0.7534{col 59} .7147572{col 73} 0.8835
{txt}w2eupan3a{col 14}{c |}{res}{col 16}2340{col 24}+{col 31} 0.8458{col 45} 0.7870{col 59} .6830197{col 73} 0.8803
{txt}w2eupan4a{col 14}{c |}{res}{col 16}2340{col 24}-{col 31} 0.6754{col 45} 0.5871{col 59}  .771298{col 73} 0.8959
{txt}w2eupan5a{col 14}{c |}{res}{col 16}2340{col 24}-{col 31} 0.6319{col 45} 0.5507{col 59} .8034658{col 73} 0.8982
{txt}w2eupan6a{col 14}{c |}{res}{col 16}2340{col 24}+{col 31} 0.7465{col 45} 0.6714{col 59} .7443569{col 73} 0.8898
{txt}w2eupan7a{col 14}{c |}{res}{col 16}2340{col 24}-{col 31} 0.7974{col 45} 0.7360{col 59} .7298376{col 73} 0.8852
{txt}w2eupan8a{col 14}{c |}{res}{col 16}2340{col 24}+{col 31} 0.7885{col 45} 0.7154{col 59} .7125675{col 73} 0.8863
{txt}w2eupan9a{col 14}{c |}{res}{col 16}2340{col 24}+{col 31} 0.6819{col 45} 0.5855{col 59} .7572321{col 73} 0.8964
{txt}{hline 13}{c +}{hline 65}
Test scale{col 14}{c |}{res}{col 59}  .738648{col 73} 0.9010
{txt}{hline 13}{c BT}{hline 65}

{com}. 
. *Reverse code so Nativist response is high end of scale
. recode w2eupan1a w2eupan3a w2eupan6a w2eupan8a w2eupan9a (1=5) (2=4) (3=3) (4=2) (5=1)
{txt}(w2eupan1a: 1776 changes made)
(w2eupan3a: 1851 changes made)
(w2eupan6a: 1621 changes made)
(w2eupan8a: 1667 changes made)
(w2eupan9a: 1643 changes made)

{com}. 
. *An additive scale
. gen natism = w2eupan1a + w2eupan2a + w2eupan3a + w2eupan4a + w2eupan5a + w2eupan6a + w2eupan7a + w2eupan8a + w2eupan9a
{txt}(4160 missing values generated)

{com}. 
. *Alpha for two-item version = 0.68
. alpha w2eupan1a w2eupan2a

{txt}Test scale = mean(unstandardized items)

Average interitem covariance:{col 34}{res} .8235637
{txt}Number of items in the scale:{col 34}{res}        2
{txt}Scale reliability coefficient:{col 34}{res}   0.6803
{txt}
{com}. 
. *Belief in free market, market regulation (measured in previous wave)
. tab w1fremkt1

{txt}People are better off in a {c |}
      free market economy. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        193        6.99        6.99
{txt}                     Agree {c |}{res}        830       30.07       37.07
{txt}Neither agree nor disagree {c |}{res}        906       32.83       69.89
{txt}                  Disagree {c |}{res}        272        9.86       79.75
{txt}         Strongly disagree {c |}{res}        121        4.38       84.13
{txt}              Don’t know {c |}{res}        438       15.87      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,760      100.00
{txt}
{com}. tab w1regmkt1

     {txt}The government has an {c |}
 essential role to play in {c |}
    regulating the market. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        423       15.33       15.33
{txt}                     Agree {c |}{res}      1,410       51.09       66.41
{txt}Neither agree nor disagree {c |}{res}        601       21.78       88.19
{txt}                  Disagree {c |}{res}        111        4.02       92.21
{txt}         Strongly disagree {c |}{res}         27        0.98       93.19
{txt}              Don’t know {c |}{res}        188        6.81      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,760      100.00
{txt}
{com}. 
. foreach var of varlist w1fremkt1 w1regmkt1 {c -(}
{txt}  2{com}. gen `var'r=`var'
{txt}  3{com}. recode `var'r (6=3) (1=5) (2=4) (3=3) (4=2) (5=1)
{txt}  4{com}. {c )-}
{txt}(3740 missing values generated)
(w1fremkt1r: 1854 changes made)
(3740 missing values generated)
(w1regmkt1r: 2159 changes made)

{com}. 
. *Additional Control Variables: 
. 
. *Retrospective economic sentiment
. foreach var of varlist w2econ1 w2econ2 {c -(}
{txt}  2{com}. gen new`var'=`var'
{txt}  3{com}. recode new`var' (1=5) (2=4) (3=3) (4=2) (5=1) (6=3)
{txt}  4{com}. {c )-}
{txt}(4147 missing values generated)
(neww2econ1: 1887 changes made)
(4146 missing values generated)
(neww2econ2: 1524 changes made)

{com}. 
. 
. *Prospective economic sentiment 
. foreach var of varlist w2econp1 w2econp2 {c -(}
{txt}  2{com}. gen new`var'=`var'
{txt}  3{com}. recode new`var' (6=3)
{txt}  4{com}. **(1=5) (2=4) (3=3) (4=2) (5=1) 
. {c )-}
{txt}(4156 missing values generated)
(neww2econp1: 93 changes made)
(4156 missing values generated)
(neww2econp2: 91 changes made)

{com}. 
. 
. *Economic Sentiment (this is really only a single dimension)
. factor neww2econ1 neww2econ2 neww2econp1 neww2econp2, ml
{txt}(obs=2344)
number of factors adjusted to {res}1
{txt}Iteration 0:   log likelihood = {res}-228.49086
{txt}Iteration 1:   log likelihood = {res}-203.16676
{txt}Iteration 2:   log likelihood = {res}-202.58052
{txt}Iteration 3:   log likelihood = {res}-202.46375
{txt}Iteration 4:   log likelihood = {res}-202.43997
{txt}Iteration 5:   log likelihood = {res}-202.43517
{txt}Iteration 6:   log likelihood = {res} -202.4342
{txt}Iteration 7:   log likelihood = {res}  -202.434
{txt}Iteration 8:   log likelihood = {res}-202.43397
{txt}Iteration 9:   log likelihood = {res}-202.43396

{txt}Factor analysis/correlation{col 52}Number of obs    = {res}    2344
{col 5}{txt}Method: maximum likelihood{col 52}Retained factors = {res}       1
{col 5}{txt}Rotation: (unrotated){col 52}Number of params = {res}       4
{col 52}{txt}Schwarz's BIC    = {res} 435.906
{col 5}{txt}Log likelihood = {res} -202.434{col 52}{txt}(Akaike's) AIC   = {res} 412.868

{txt}{col 5}{hline 13}{c TT}{hline 60}
{col 5}     Factor  {c |} {ralign 12:Eigenvalue}   Difference        Proportion   Cumulative
{col 5}{hline 13}{c +}{hline 60}
{col 5}{ralign 11:Factor1}  {c |}{res}      2.02002            .            1.0000       1.0000
{txt}{col 5}{hline 13}{c BT}{hline 60}
{col 5}LR test: independent vs. saturated:  chi2({res}6{txt})  ={res} 3213.35{txt} Prob>chi2 ={res} 0.0000
{txt}{col 5}LR test: {res}   1{txt} factor vs. saturated:  chi2({res}2{txt})  ={res}  404.38{txt} Prob>chi2 ={res} 0.0000

{txt}Factor loadings (pattern matrix) and unique variances

{space 4}{hline 13}{c  TT}{hline 10}{c  TT}{hline 14}
{space 4}{space 0}{ralign 12:Variable}{space 1}{c |}{space 1}{ralign 8:Factor1}{space 1}{c |}{space 1}{ralign 12:Uniqueness}{space 1}
{space 4}{hline 13}{c   +}{hline 10}{c   +}{hline 14}
{space 4}{space 0}{ralign 12:neww2econ1}{space 1}{c |}{space 1}{ralign 8:{res:{sf:  0.7197}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.4820}}}{space 1}
{space 4}{space 0}{ralign 12:neww2econ2}{space 1}{c |}{space 1}{ralign 8:{res:{sf:  0.6094}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.6286}}}{space 1}
{space 4}{space 0}{ralign 12:neww2econp1}{space 1}{c |}{space 1}{ralign 8:{res:{sf:  0.7340}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.4613}}}{space 1}
{space 4}{space 0}{ralign 12:neww2econp2}{space 1}{c |}{space 1}{ralign 8:{res:{sf:  0.7693}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.4081}}}{space 1}
{space 4}{hline 13}{c  BT}{hline 10}{c  BT}{hline 14}

{com}. *alpha=0.80
. alpha neww2econ1 neww2econ2 neww2econp1 neww2econp2, item gen(econsentimentw2)

{txt}Test scale = mean(unstandardized items)

                                                            average
                             item-test     item-rest       interitem
Item         {c |}  Obs  Sign   correlation   correlation     covariance      alpha
{hline 13}{c +}{hline 65}
neww2econ1{col 14}{c |}{res}{col 16}2353{col 24}+{col 31} 0.7952{col 45} 0.6250{col 59} .4241475{col 73} 0.7452
{txt}neww2econ2{col 14}{c |}{res}{col 16}2354{col 24}+{col 31} 0.7464{col 45} 0.5450{col 59} .4650813{col 73} 0.7829
{txt}neww2econp1{col 14}{c |}{res}{col 16}2344{col 24}+{col 31} 0.8106{col 45} 0.6529{col 59} .4116833{col 73} 0.7320
{txt}neww2econp2{col 14}{c |}{res}{col 16}2344{col 24}+{col 31} 0.8133{col 45} 0.6343{col 59}    .3948{col 73} 0.7407
{txt}{hline 13}{c +}{hline 65}
Test scale{col 14}{c |}{res}{col 59} .4239148{col 73} 0.8006
{txt}{hline 13}{c BT}{hline 65}

{com}. *rescale 0 to 1
. replace econsentimentw2=econsentimentw2-1
{txt}(2354 real changes made)

{com}. replace econsentimentw2=econsentimentw2/4 
{txt}(2194 real changes made)

{com}. 
. *Universalism
. tab w2Univ2f1

{txt}She wants everyone {c |}
     to be treated {c |}
     justly. It is {c |}
  important to her {c |}
  to protect the w {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        305       24.07       24.07
{txt}           Like me {c |}{res}        362       28.57       52.64
{txt}  Somewhat like me {c |}{res}        295       23.28       75.93
{txt}  A little like me {c |}{res}        217       17.13       93.05
{txt}       Not like me {c |}{res}         55        4.34       97.40
{txt}Not like me at all {c |}{res}         10        0.79       98.18
{txt}        Dont know {c |}{res}         23        1.82      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,267      100.00
{txt}
{com}. recode w2Univ2f1 (7=3.5), gen(Univ2f)
{txt}(23 differences between w2Univ2f1 and Univ2f)

{com}. tab w2Univ3f1

 {txt}She believes that {c |}
    all voices are {c |}
   important.  She {c |}
  wants all people {c |}
    to have the op {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        204       16.10       16.10
{txt}           Like me {c |}{res}        380       29.99       46.09
{txt}  Somewhat like me {c |}{res}        341       26.91       73.01
{txt}  A little like me {c |}{res}        237       18.71       91.71
{txt}       Not like me {c |}{res}         66        5.21       96.92
{txt}Not like me at all {c |}{res}          9        0.71       97.63
{txt}        Dont know {c |}{res}         30        2.37      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,267      100.00
{txt}
{com}. recode w2Univ3f1 (7=3.5), gen(Univ3f)
{txt}(30 differences between w2Univ3f1 and Univ3f)

{com}. tab w2Univ2m1

 {txt}He wants everyone {c |}
     to be treated {c |}
     justly. It is {c |}
  important to him {c |}
 to protect the we {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        244       21.88       21.88
{txt}           Like me {c |}{res}        361       32.38       54.26
{txt}  Somewhat like me {c |}{res}        268       24.04       78.30
{txt}  A little like me {c |}{res}        146       13.09       91.39
{txt}       Not like me {c |}{res}         50        4.48       95.87
{txt}Not like me at all {c |}{res}         18        1.61       97.49
{txt}        Dont know {c |}{res}         28        2.51      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,115      100.00
{txt}
{com}. recode w2Univ2m1 (7=3.5), gen(Univ2m)
{txt}(28 differences between w2Univ2m1 and Univ2m)

{com}. tab w2Univ3m1

  {txt}He believes that {c |}
    all voices are {c |}
    important.  He {c |}
  wants all people {c |}
  to have the oppo {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        134       12.02       12.02
{txt}           Like me {c |}{res}        346       31.03       43.05
{txt}  Somewhat like me {c |}{res}        320       28.70       71.75
{txt}  A little like me {c |}{res}        204       18.30       90.04
{txt}       Not like me {c |}{res}         66        5.92       95.96
{txt}Not like me at all {c |}{res}         14        1.26       97.22
{txt}        Dont know {c |}{res}         31        2.78      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,115      100.00
{txt}
{com}. recode w2Univ3m1 (7=3.5), gen(Univ3m)
{txt}(31 differences between w2Univ3m1 and Univ3m)

{com}. *recode so high end of the scale = more commitment to universalism
. recode Univ2f Univ3f Univ2m Univ3m (1=6) (2=5) (3=4) (4=3) (5=2) (6=1)
{txt}(Univ2f: 1244 changes made)
(Univ3f: 1237 changes made)
(Univ2m: 1087 changes made)
(Univ3m: 1084 changes made)

{com}. 
. *combine male and female responses into single variable
. gen Univ2 = Univ2f 
{txt}(5233 missing values generated)

{com}. replace Univ2 = Univ2m if Univ2m !=.
{txt}(1115 real changes made)

{com}. gen Univ3 = Univ3f
{txt}(5233 missing values generated)

{com}. replace Univ3 = Univ3m if Univ3m !=.
{txt}(1115 real changes made)

{com}. 
. gen univ = Univ2 + Univ3
{txt}(4118 missing values generated)

{com}. *alpha = 0.74
. alpha Univ2 Univ3

{txt}Test scale = mean(unstandardized items)

Average interitem covariance:{col 34}{res} .8065599
{txt}Number of items in the scale:{col 34}{res}        2
{txt}Scale reliability coefficient:{col 34}{res}   0.7398
{txt}
{com}. 
. *repeat for conformity 
. tab w2Conform1f1

{txt}It is important to {c |}
     her to behave {c |}
     properly. She {c |}
   believes people {c |}
 should do what th {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        176       13.89       13.89
{txt}           Like me {c |}{res}        326       25.73       39.62
{txt}  Somewhat like me {c |}{res}        278       21.94       61.56
{txt}  A little like me {c |}{res}        279       22.02       83.58
{txt}       Not like me {c |}{res}        145       11.44       95.03
{txt}Not like me at all {c |}{res}         38        3.00       98.03
{txt}        Dont know {c |}{res}         25        1.97      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,267      100.00
{txt}
{com}. recode w2Conform1f1 (7=3.5), gen(Conform1f)
{txt}(25 differences between w2Conform1f1 and Conform1f)

{com}. tab w2Conform1m1

{txt}It is important to {c |}
     him to behave {c |}
      properly. He {c |}
   believes people {c |}
should do what the {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        122       10.94       10.94
{txt}           Like me {c |}{res}        319       28.61       39.55
{txt}  Somewhat like me {c |}{res}        300       26.91       66.46
{txt}  A little like me {c |}{res}        198       17.76       84.22
{txt}       Not like me {c |}{res}        106        9.51       93.72
{txt}Not like me at all {c |}{res}         40        3.59       97.31
{txt}        Dont know {c |}{res}         30        2.69      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,115      100.00
{txt}
{com}. recode w2Conform1m1 (7=3.5), gen(Conform1m)
{txt}(30 differences between w2Conform1m1 and Conform1m)

{com}. recode Conform1f Conform1m (1=6) (2=5) (3=4) (4=3) (5=2) (6=1)
{txt}(Conform1f: 1242 changes made)
(Conform1m: 1085 changes made)

{com}. 
. *combine male and female responses into single variable
. gen conform = Conform1f
{txt}(5233 missing values generated)

{com}. replace conform = Conform1m if Conform1m !=.
{txt}(1115 real changes made)

{com}. 
. 
. 
. **********************************
. **** Coding for experimental data
. *********************************
. 
. *Recode DK to midpoint*
. recode w2trade3a (6=3), gen(tradea)
{txt}(138 differences between w2trade3a and tradea)

{com}. recode w2trade3b (6=3), gen(tradeb)
{txt}(159 differences between w2trade3b and tradeb)

{com}. 
. *Generate a variable for experimental condition, DK at midpoint*
. gen tradeinfohi = .
{txt}(6500 missing values generated)

{com}. replace tradeinfohi = 1 if tradea != .
{txt}(1164 real changes made)

{com}. replace tradeinfohi = 0 if tradeb != .
{txt}(1171 real changes made)

{com}. 
. gen supptrade = .
{txt}(6500 missing values generated)

{com}. replace supptrade = tradea if tradea != .f
{txt}(1164 real changes made)

{com}. replace supptrade = tradeb if tradeb != .
{txt}(1171 real changes made)

{com}. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\f002mrh\Dropbox\Trade Attitudes\Data and Code\Replication Files for FPA\\UKcodinglog.txt
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}20 Nov 2020, 12:04:07
{txt}{.-}
{smcl}
{txt}{sf}{ul off}